﻿<UserControl x:Class="WindowSwitcher.ListboxCustomItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             Loaded="UserControl_Loaded"
             xmlns:converter="clr-namespace:WindowSwitcher.Converter"
             mc:Ignorable="d" 
             d:DesignHeight="56" d:DesignWidth="500">
    <UserControl.Resources>
        <converter:KeyConverter x:Key="keyConverter" />
        <converter:BindingConverter x:Key="bindingConverter" />
        <converter:ImageConverter x:Key="imgConverter" />
    </UserControl.Resources>
    <DockPanel>
        <Image Name="Avatar" Height="56" Width="56" DockPanel.Dock="Left" Source="{Binding AvatarSource}"/>
        <TextBlock Name="txttt" VerticalAlignment="Center" Margin="10,0,0,0" Text="Window to handle :"></TextBlock>
        <ComboBox Name="CBX1" Height="25" Width="150" Margin="20,0,0,0" ItemsSource="{Binding CbxItemsSource1}" DisplayMemberPath="HandleName" SelectedValue="HandleName" SelectionChanged="ComboBox_SelectionChanged">
            <ComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="IsEnabled" Value="{Binding Enabled}"/>
                </Style>
            </ComboBox.ItemContainerStyle>
        </ComboBox>

        <ComboBox Height="25" Width="50" DockPanel.Dock="Right" ItemsSource="{Binding CbxItemsSource2}" SelectionChanged="ComboBox_SelectionChanged_1">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Key, Converter={StaticResource keyConverter}}"/>
                </DataTemplate>
            </ComboBox.ItemTemplate>
            <ComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="IsEnabled" Value="{Binding Enabled}"/>
                </Style>
            </ComboBox.ItemContainerStyle>
        </ComboBox>
        <TextBlock VerticalAlignment="Center" Margin="30,0,20,0" DockPanel.Dock="Right">Key shortcut : </TextBlock>
    </DockPanel>
</UserControl>
